package com.woniu.teachmall.mapper;

import com.woniu.teachmall.entity.Address;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface AddressMapper {
    List<Address> getAddress(Integer userId);

    Address getAddressById(Integer addressId);
    int addAddress(Address address);
    // 删除地址
    int deleteAddress(Integer addressId);
    // 更新地址
    int updateAddress(Address address);
    // 统计用户地址数量（用于校验上限）
    int countByUserId(Integer userId);
    // 清除其他默认地址标记
    int clearDefaultFlags(Integer userId);
}
